<template>
	<div>
		<el-form :inline="true" :model="formInline" class="demo-form-inline">
			<el-form-item label="审批人">
				<el-input v-model="formInline.user" placeholder="审批人"></el-input>
			</el-form-item>
			<el-form-item label="活动区域">
				<el-select v-model="formInline.region" placeholder="活动区域">
					<el-option label="区域一" value="shanghai"></el-option>
					<el-option label="区域二" value="beijing"></el-option>
				</el-select>
			</el-form-item>
			<el-button type="primary" @click="onSubmit">获取父级Token</el-button>
			<div style="margin-top: 5vh"></div>
			<el-button type="primary" @click="openView">跳转到子应用2 并传值123456</el-button>
		</el-form>
	</div>
</template>
<script>
export default {
	data() {
		return {
			formInline: {
				user: '',
				region: ''
			}
		}
	},
	created() {
		this.$message.success('获取子应用2传参id为：' + this.$route.query.id)
	},
	methods: {
		onSubmit() {
			this.$message.success(localStorage.getItem('token'))
		},
		openView() {
			this.$mainApp.router.push({
				path: '/sub-project2',
				query: {
					id: '123456'
				}
			})
		}
	}
}
</script>